<script setup>

/**
 * @import pinia stores
 */

 // pinia -> useHomePageStore
import { useHomePageStore } from '@/stores/index/homePage.js'

/**
 * @function publishButtonClick 发布按钮被点击
 */
const {publishButtonClick} = useHomePageStore()

/**
 * 发布按钮被点击事件
 */
const publishButtonClickEvent = () => {
    publishButtonClick()
}

</script>

<template>
    <div class="floating-publish-button">
        <div>
            <image class="icon-class" src="@/static/icons/publish.svg" @click.stop="publishButtonClickEvent"  mode="scaleToFill" />
        </div>
        <div class="publish-text">发布</div>
    </div>
</template>

<style scoped>

.floating-publish-button {
    width: 90rpx;
    height: 90rpx;
    background-color: #f0b979;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: fixed;
    bottom: 12vh;
    right: 3vw;
    z-index: 998;
}

.icon-class {
    width: 45rpx;
    height: 45rpx;
}

.publish-text {
    color: #fff;
    font-size: 15rpx;
    position: relative;
    top: -10rpx;
}
</style>